x86: infrastructure to allow converting certain indirect calls to direct ones
authorJan Beulich <jbeulich@suse.com>
Fri, 17 May 2019 12:36:36 +0000 (14:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 17 May 2019 12:36:36 +0000 (14:36 +0200)
commit67d01cdb551880653dacf80af39f8b5280f1879c
tree65f7effda64cc8c1ac86a6c6f3053839fb796130
parente28e639f5d2a541435b871d4e3af0c09b15a5d00
x86: infrastructure to allow converting certain indirect calls to direct ones

In a number of cases the targets of indirect calls get determined once
at boot time. In such cases we can replace those calls with direct ones
via our alternative instruction patching mechanism.

Some of the targets (in particular the hvm_funcs ones) get established
only in pre-SMP initcalls, making necessary a second passs through the
alternative patching code. Therefore some adjustments beyond the
recognition of the new special pattern are necessary there.

Note that patching such sites more than once is not supported (and the
supplied macros also don't provide any means to do so).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
xen/arch/x86/alternative.c
xen/arch/x86/setup.c
xen/include/asm-x86/alternative.h
xen/include/xen/lib.h